﻿<%@ Control Language="C#" AutoEventWireup="true" CodeFile="Contact.ascx.cs"
    Inherits="webapp4U.UI.Control.Contact" %>
<%@ Import Namespace="webapp4U" %>
<%@ Register TagPrefix="webapp4U" Namespace="webapp4U.UI" %>

<asp:UpdatePanel ID="UpdatePanelContactPersons" runat="server" UpdateMode="Conditional">
<ContentTemplate>

<table align="center" cellpadding="0" cellspacing="0">
<tr>
    <td align="center">
        <asp:GridView runat="server"
                ID="GridViewItem" 
                Width="700" 
                DataSourceID="ObjectDataSource"
                AutoGenerateColumns="false" 
                DataKeyNames="ContactID" 
                AllowPaging="True" 
                AllowSorting="True" 
                PagerSettings-Mode="NumericFirstLast"
                PageSize="25">
                <Columns>
                     <asp:TemplateField ItemStyle-HorizontalAlign="Center" ItemStyle-Width="20px" HeaderStyle-Width="20px" HeaderText="Delete">
                        <HeaderTemplate>
                            <input id="chkAll" onclick="javascript:SelectAllCheckboxes(this);" runat="server" type="checkbox" />
                        </HeaderTemplate>
                        <ItemTemplate>
                            <asp:CheckBox runat="server" ID="chkSelect" ToolTip='<%# Eval("ContactID") %>' />
                        </ItemTemplate>
                    </asp:TemplateField>
                    
                    <asp:TemplateField HeaderText="Title" 
                    HeaderStyle-HorizontalAlign="left"
                    ItemStyle-HorizontalAlign ="left">
                        <ItemTemplate>
                            <a href="<%=Globals.ApplicationPath %>WebMaster/Contacts/ContactDetail.aspx?ContactID=<%# Eval("ContactID")%>">
                                <b><%# Eval("Title")%></b>
                            </a>
                        </ItemTemplate>
                    </asp:TemplateField>
                    
                    <asp:TemplateField HeaderText="Date" 
                        HeaderStyle-HorizontalAlign="left"
                        ItemStyle-HorizontalAlign ="left">
                        <ItemTemplate><%# Formatter.FormatDate((DateTime)Eval("AddedDate"))%></ItemTemplate>
                    </asp:TemplateField>
                    
                </Columns>
                                        
                <EmptyDataTemplate>
                    <table align="center" width="300" border="0" bordercolorlight="#0099cc"  bordercolor="#0099cc">
                        <tr>
                            <td height="50" align="center">
                                <div align="center" id="EmptyData"><%=ResourceManager.GetString("DataEmpty") %></div>
                            </td>   
                        </tr>
                    </table>
                </EmptyDataTemplate>
            </asp:GridView>    
            
           <table align="center" border="0" cellpadding="0" cellspacing="0" width="700">
             <tr>
                <td align="right" width="100%">
                    <br />
                        <asp:LinkButton runat="server" ID="btDelete" Text="Delete" OnClick="btDelete_Click" />
                    <br /><br />
                </td>
             </tr>
           </table>
    </td>
</tr>
</table>

</ContentTemplate>
</asp:UpdatePanel>


<asp:ObjectDataSource
    ID="ObjectDataSource"
    runat="server"
    SelectMethod="GetContactByCateID"
    TypeName="webapp4U.BOL.Contact">
    <SelectParameters>
        <asp:QueryStringParameter Name="CateID" QueryStringField="CateID" Type="Int32" DefaultValue="1" />
    </SelectParameters>
</asp:ObjectDataSource>        
